Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reviving missing build files in the android-example #1518

Closed
wants to merge 37 commits into from
Closed

Reviving missing build files in the android-example #1518

wants to merge 37 commits into from

Conversation

Scrappers-glitch
Copy link
Contributor

  • Made the example runnable via Android Studio.
  • Created new Build files(that was missing) :
    * settings.gradle
    * gradlew.bat
    * gradle.properties
  • One more internal code fix.

To Run the example :

Android Studio - > Open Project -> select -> jme3-android-tests folder(root module)

@@ -1,5 +1,6 @@
#Fri Apr 09 04:09:56 CDT 2021
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes to "gradle-wrapper.properties" appear to be unnecessary. Please revert them.

## This file must *NOT* be checked into Version Control Systems,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this file checked into Git? The comments suggest it should be removed from the Git repo and listed in a .gitignore file.

@Scrappers-glitch
Copy link
Contributor Author

@stephengold thanks for reviewing, but I think I messed this PR out, I have backed up my changes, do you think it's better to close this & do a new PR ?

@stephengold
Copy link
Member

Whatever you did, I'm sure it's fixable. But if opening a new PR is easier for you, go right ahead. I won't complain.

implementation "org.jmonkeyengine:jme3-jbullet:3.4.0-alpha7"
implementation "org.jmonkeyengine:jme3-effects:3.4.0-alpha7"
implementation "org.jmonkeyengine:jme3-android-native:3.4.0-alpha7"
implementation "org.jmonkeyengine:jme3-lwjgl:3.4.0-alpha7"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why jme3-lwjgl is in dependencies?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ali-RS thanks for reviewing,
yeh, the author who made this android example, uses all jmonkeyengine examples through direct gradle dependiceis (of test-data & examples) & classNames, i haven't dig deeper inside jme3-examples, so i thought may be at least one example would use something lwjgl related, but you are right lwjgl is useless for android.

/*add the JMonkeyEngine Dependencies*/
runtimeOnly project(":stack-alloc")
implementation project(":jbullet")
implementation "org.jmonkeyengine:jme3-core:3.4.0-alpha7"
Copy link
Member

@Ali-RS Ali-RS Apr 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this is changed from compile project(':jme3-core') to implementation "org.jmonkeyengine:jme3-core:3.4.0-alpha7"?

the same goes for other dependencies as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, it's because i have separated this android-example in a separate module(package) from jmonkeyengine, that has it's own gradle builds & source, that was the only way to make it runnable, because Android gradle is different from java gradle, btw this example wasn't runnable & there were build files that are missing, listed in the title of the PR.

If you have a good idea of including the folders that aren't in project root module(ie from local disk) in gradle, we could try it instead of remote implementation.

@@ -0,0 +1,26 @@
package com.scrappers.myapplication;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the package name is changed to com.scrappers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, i did make sure that all package names are assigned to jme3 but seems i have forgot to refractor the testClasses

@@ -0,0 +1 @@
o/jetified-jbullet.jar
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is jetified-jbullet?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the Jetifier is a standalone tool shipped with the new Androidx packages, it eases migration of libraries to be usable inside androidx,

https://developer.android.com/studio/command-line/jetifier

Copy link
Member

@Ali-RS Ali-RS Apr 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you include jbullet and stack-alloc using Android Gradle plugin and without using the Jetifier?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tried, but there was an error, cannot remember.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it works & i was wrong about using jetifier in this situation, i replied back on forums.

@@ -0,0 +1 @@
i/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this .bin file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what these files are really, but they are getting generated by Android Jetifier when importing jbullet & stack-alloc (as you know from the forum) to the main android module

image

@@ -0,0 +1 @@
o/jetified-jbullet
Copy link
Member

@Ali-RS Ali-RS Apr 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this .bin and why jetified-jbullet/classes.dex is committed to repo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, as i answered before, they are build files for jbullet.jar files, since they are imported as modules, they get extracted,& build by android

@@ -0,0 +1 @@
o/jetified-stack-alloc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is jetified-stack-alloc and why jetified-stack-alloc/classes.dex is committed to repo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.dex extension files are the dalvik vm executable files, they are auto-generated by android studio here as a conversion from .class(from the jar file) to .dex to be runnable inside an apk package, that's why it needs to be imported as android module & not copied/pasted as jar.

https://source.android.com/devices/tech/dalvik/dex-format

Copy link
Member

@Ali-RS Ali-RS Apr 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean if they are automatically generated when building the project then I think you should not include any of those (.bin, .dex, jetified jars) in the PR, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If i use the import module feature of jetifier, then they are extracts & remodifications of jars, that must be added by default or you will get a broken project ofc, but if i tried again the gradle jar, and we reached a fix then this would be done(conversion) of files to dex format only inside an apk file using the adb only & it won't be included in the PR.

@Ali-RS
Copy link
Member

Ali-RS commented Apr 10, 2021

Closing this as requested from OP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants